/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2013 All Rights Reserved.
 */
package com.pingan.mobilegw.core.model;

import com.pingan.mobilegw.adapterservice.model.ToString;
import com.pingan.mobilegw.core.model.enums.ControlKey;
import com.pingan.mobilegw.core.model.enums.ServiceStatus;

import java.util.HashMap;
import java.util.Map;

/**
 * 服务配置
 * 
 * @author jiadao
 * @version $Id: ServiceConfig.java, v 0.1 2013-4-8 上午8:58:25 jiadao Exp $
 */
public class ServiceConfig extends ToString implements Cloneable {

    /** serialVersionUID */
    private static final long       serialVersionUID = -1475172002941857787L;

    /** 接口名 */
    private String                  operationType;

    /** 系统名 */
    private String                  sysName;

    /** 接口名 */
    private String                  interfaceType;

    /** 方法名 */
    private String                  methodName;

    /** 服务状态 */
    private ServiceStatus           status;

    /** 是否为本地硬编码服务 */
    private boolean                 isLocal;

    /** 服务控制规则 */
    private Map<ControlKey, String> controlRules     = new HashMap<ControlKey, String>();

    /**
     * 添加服务控制规则
     * 
     * @param key
     * @param value
     */
    public void addRules(ControlKey key, String value) {
        controlRules.put(key, value);
    }

    /**
     * 获取某个控制规则
     * 
     * @param key
     * @return
     */
    public String getRule(ControlKey key) {
        return controlRules.get(key);
    }

    /**
     * Getter method for property <tt>operationType</tt>.
     * 
     * @return property value of operationType
     */
    public String getOperationType() {
        return operationType;
    }

    /**
     * Setter method for property <tt>operationType</tt>.
     * 
     * @param operationType value to be assigned to property operationType
     */
    public void setOperationType(String operationType) {
        this.operationType = operationType;
    }

    /**
     * Getter method for property <tt>sysName</tt>.
     * 
     * @return property value of sysName
     */
    public String getSysName() {
        return sysName;
    }

    /**
     * Setter method for property <tt>sysName</tt>.
     * 
     * @param sysName value to be assigned to property sysName
     */
    public void setSysName(String sysName) {
        this.sysName = sysName;
    }

    /**
     * Getter method for property <tt>interfaceType</tt>.
     * 
     * @return property value of interfaceType
     */
    public String getInterfaceType() {
        return interfaceType;
    }

    /**
     * Setter method for property <tt>interfaceType</tt>.
     * 
     * @param interfaceType value to be assigned to property interfaceType
     */
    public void setInterfaceType(String interfaceType) {
        this.interfaceType = interfaceType;
    }

    /**
     * Getter method for property <tt>methodName</tt>.
     * 
     * @return property value of methodName
     */
    public String getMethodName() {
        return methodName;
    }

    /**
     * Setter method for property <tt>methodName</tt>.
     * 
     * @param methodName value to be assigned to property methodName
     */
    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    /**
     * Getter method for property <tt>status</tt>.
     * 
     * @return property value of status
     */
    public ServiceStatus getStatus() {
        return status;
    }

    /**
     * Setter method for property <tt>status</tt>.
     * 
     * @param status value to be assigned to property status
     */
    public void setStatus(ServiceStatus status) {
        this.status = status;
    }

    /**
     * Getter method for property <tt>controlRules</tt>.
     * 
     * @return property value of controlRules
     */
    public Map<ControlKey, String> getControlRules() {
        return controlRules;
    }

    /**
     * Setter method for property <tt>controlRules</tt>.
     * 
     * @param controlRules value to be assigned to property controlRules
     */
    public void setControlRules(Map<ControlKey, String> controlRules) {
        this.controlRules = controlRules;
    }

    /**
     * Getter method for property <tt>isLocal</tt>.
     * 
     * @return property value of isLocal
     */
    public boolean isLocal() {
        return isLocal;
    }

    /**
     * Setter method for property <tt>isLocal</tt>.
     * 
     * @param isLocal value to be assigned to property isLocal
     */
    public void setLocal(boolean isLocal) {
        this.isLocal = isLocal;
    }

}
